package com.wkt.ggkt.vod.controller;

import com.wkt.ggkt.result.Result;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wangkt
 * @Describe
 * @date 2022/7/2 17:56
 */
@Api("用户登录控制器")
@RestController
@RequestMapping("/admin/vod/user")
//@CrossOrigin
public class UserLoginController {

    @PostMapping("/login")
    public Result login() {
        //{code: 20000, data: {token: "admin-token"}}
        Map<String, Object> map = new HashMap();

        map.put("token","admin-token");
        return Result.ok(map);
    }

    @GetMapping("/info")
    public Result info() {
        Map<String, Object> map = new HashMap();
        //{"code":20000,
        // "data":
        // {"roles":["admin"],
        // "introduction":"I am a super administrator",
        // "avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
        // "name":"Super Admin"}}

        map.put("roles","admin");
        map.put("introduction","I am a super administrator");
        map.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        map.put("name","Super Admin");

        return Result.ok(map);
    }
}
